package org.insia.smartposse.mapping.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the skill_trees table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="skill_trees"
 */

public abstract class BaseSkillTrees  implements Serializable {

	public static String REF = "SkillTrees";
	public static String PROP_SKILL = "Skill";
	public static String PROP_PARENT_ID = "ParentId";
	public static String PROP_GROUP_NAME = "GroupName";
	public static String PROP_ID = "Id";


	// constructors
	public BaseSkillTrees () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseSkillTrees (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.String groupName;

	// many to one
	private org.insia.smartposse.mapping.Skills parentId;
	private org.insia.smartposse.mapping.Skills skill;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="increment"
     *  column="skill_trees_id"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: group_name
	 */
	public java.lang.String getGroupName () {
		return groupName;
	}

	/**
	 * Set the value related to the column: group_name
	 * @param groupName the group_name value
	 */
	public void setGroupName (java.lang.String groupName) {
		this.groupName = groupName;
	}



	/**
	 * Return the value associated with the column: parent_id
	 */
	public org.insia.smartposse.mapping.Skills getParentId () {
		return parentId;
	}

	/**
	 * Set the value related to the column: parent_id
	 * @param parentId the parent_id value
	 */
	public void setParentId (org.insia.smartposse.mapping.Skills parentId) {
		this.parentId = parentId;
	}



	/**
	 * Return the value associated with the column: skill_id
	 */
	public org.insia.smartposse.mapping.Skills getSkill () {
		return skill;
	}

	/**
	 * Set the value related to the column: skill_id
	 * @param skill the skill_id value
	 */
	public void setSkill (org.insia.smartposse.mapping.Skills skill) {
		this.skill = skill;
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof org.insia.smartposse.mapping.SkillTrees)) return false;
		else {
			org.insia.smartposse.mapping.SkillTrees skillTrees = (org.insia.smartposse.mapping.SkillTrees) obj;
			if (null == this.getId() || null == skillTrees.getId()) return false;
			else return (this.getId().equals(skillTrees.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}